// components/pay-warn/index.js
const app = getApp();
Component({
    /**
     * 组件的属性列表
     */
    properties: {
        // data: {
        //     type: Object,
        //     value: {
        //         show: false,
        //         debt: ''
        //     }
        // }
    },

    /**
     * 组件的初始数据
     */
    data: {
        dialog: false
    },
    attached() {
        /* 欠款提醒 */
        var that = this;
        // /fms/accountsRechargeOrder/checkEnsureMoneyStatus
        app.baseGet(app.U({
            m: 'fms',
            c: 'accountsRechargeOrder',
            a: 'checkEnsureMoneyStatus',
            q: {
                deptId: wx.getStorageSync('userInfo').id,
                deptType: wx.getStorageSync('userInfo').userType
            }
        }), res => {
            console.log(res)
            that.setData({
                debt: res.data,
                dialog: res.data.ensureMoney < res.data.oweMoney ? true : false
            })
        }, (res) => {})
    },
    /**
     * 组件的方法列表
     */
    methods: {
        goPay() {
            wx.navigateTo({
                url: '/pages/subrogation/moneyPay/index?money=' + this.data.debt.proposalRechargeMoney,
            })
        },
        exit() {
            // wx.exitMiniProgram({
            //     success: function (res) {
            //         console.log(res)
            //     }
            // })
            this.setData({
                dialog: false
            })
        },
        touchmove(){
            return
        }
    }
})